$(document).ready(function(){
	debug:true;

	$('.buy').click(function(event) {  
	    var productOid=$(this).data('val');
	    //alert(productOid);
	    $.ajax({  
	 	    type: "POST",  
	 	    url: "cart-process",  
	 	    data: "productOid="+productOid+"&region="+geoplugin_region().replace(/s/g, 'x'),  
	 	    success: function(){  
	 	    	
	 	    	$('#nProductosContainer').load('include/carrito.jsp #cartArriba');
	 	    	$('#totalPedidoContenedor').load('include/carrito.jsp #totalPedido');
	 	    	$('#open-panel').load('include/carrito.jsp .content-carrito');
	 	    	
	 	           
	 	    } 
	});
	    return false;
	}); 
	
	$(document).on("click",".icon-remove-sign", function(){
		//alert("eoo");
		var oidItem=$(this).parent().data('val');
	    //alert(oidItem);
		$(this).parents(".item-in-cart").animate({
            opacity: 0
        }, "swing", function() {
            $(this).slideUp();
        });
	    $.ajax({  
	 	    type: "POST",  
	 	    url: "delete-line",  
	 	    data: "oidLinea="+oidItem,  
	 	    success: function(){  
	 	    	$('#nProductosContainer').load('include/carrito.jsp #cartArriba');
	 	    	$('#totalPedidoContenedor').load('include/carrito.jsp #totalPedido');
	 	    	
	 	    } 
	});
	    return false;
		});
		
	
}); 



